package com.sc.nft.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.dto.DrawPrizeDTO;
import com.sc.nft.dto.TaskPrizeDTO;
import com.sc.nft.entity.SaasUserTask;
import com.sc.nft.entity.Task;
import com.sc.nft.entity.TaskDrawPrize;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.vo.TaskListVO;
import com.sc.nft.enums.task.DrawPriceTypeEnum;
import com.sc.nft.enums.task.ParticipantsEnum;
import com.sc.nft.enums.task.TaskOrderTypeEnum;
import com.sc.nft.enums.task.TaskTypeEnum;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 任务表服务接口
 *
 * @author 张翔宇
 * @description 由 Mybatisplus Code Generator 创建
 * @since 2023-03-29 11:14:52
 */
public interface TaskService {

    /**
     * 添加任务
     *
     * @param taskIcon
     * @param taskName
     * @param taskPanelId
     * @param buyCollectionId
     * @param inviteCount
     * @param partakeCollectionId
     * @param participants
     * @param superiorLimit
     * @param taskStartDate
     * @param taskEndDate
     * @param taskPrizeDTOS
     */
    void addTask(String taskIcon, Integer taskPlan , String taskName, Long taskPanelId, Long buyCollectionId, Integer inviteCount, Long partakeCollectionId, ParticipantsEnum participants, Integer superiorLimit, Date taskStartDate, Date taskEndDate, List<TaskPrizeDTO> taskPrizeDTOS, Integer sort, BigDecimal totalPrice,Boolean collectionRange,Boolean mallRange,List<Long> linkIds);

    /**
     * 添加商户任务
     *
     * @param taskIcon
     * @param taskName
     * @param taskPanelId
     * @param buyCollectionId
     * @param inviteCount
     * @param partakeCollectionId
     * @param participants
     * @param superiorLimit
     * @param taskStartDate
     * @param taskEndDate
     * @param taskPrizeDTOS
     * @param sort
     * @param daoId
     */
    void addMerchantTask(String taskIcon,Integer taskPlan, String taskName, Long taskPanelId, Long buyCollectionId, Integer inviteCount, Long partakeCollectionId, ParticipantsEnum participants, Integer superiorLimit, Date taskStartDate, Date taskEndDate, List<TaskPrizeDTO> taskPrizeDTOS, Integer sort, Long daoId, BigDecimal totalPrice,Boolean collectionRange,Boolean mallRange,List<Long> linkIds);

    Task getById(Long id);

    /**
     * 修改任务
     *
     * @param id
     * @param taskIcon
     * @param taskName
     * @param taskPanelId
     * @param buyCollectionId
     * @param inviteCount
     * @param partakeCollectionId
     * @param participants
     * @param superiorLimit
     * @param taskStartDate
     * @param taskEndDate
     * @param taskPrizeDTOS
     */
    void editTask(Long id, String taskIcon,Integer taskPlan, String taskName, Long taskPanelId, Long buyCollectionId, Integer inviteCount, Long partakeCollectionId, ParticipantsEnum participants, Integer superiorLimit, Date taskStartDate, Date taskEndDate, List<TaskPrizeDTO> taskPrizeDTOS, Integer sort, BigDecimal totalPrice,Boolean collectionRange,Boolean mallRange,List<Long> linkIds);

    /**
     * 修改任务(商户)
     *
     * @param id
     * @param taskIcon
     * @param taskName
     * @param taskPanelId
     * @param buyCollectionId
     * @param inviteCount
     * @param partakeCollectionId
     * @param participants
     * @param superiorLimit
     * @param taskStartDate
     * @param taskEndDate
     * @param taskPrizeDTOS
     * @param sort
     */
    void editMerchantTask(Long id,Integer taskPlan, String taskIcon, String taskName, Long taskPanelId, Long buyCollectionId, Integer inviteCount, Long partakeCollectionId, ParticipantsEnum participants, Integer superiorLimit, Date taskStartDate, Date taskEndDate, List<TaskPrizeDTO> taskPrizeDTOS, Integer sort,BigDecimal totalPrice,Boolean collectionRange,Boolean mallRange,List<Long> linkIds);

    /**
     * 任务列表
     *
     * @param name
     * @param status
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<Task> taskPage(String name, Boolean status, Long daoId, int pageNo, int pageSize);

    /**
     * 商户任务列表
     *
     * @param name
     * @param status
     * @param daoId
     * @param pageNo
     * @param pageSize
     * @return
     */
    Page<Task> taskMerchantPage(String name, Boolean status, Long daoId, int pageNo, int pageSize);

    /**
     * 根据任务id修改排序
     *
     * @param id
     * @param sort
     */
    void changeTaskOrder(Long id, Integer sort);

    /**
     * 审核商户任务
     *
     * @param id
     * @param status
     */
    void auditMerchantTask(Long id, Integer status, String reason);

    /**
     * 删除任务
     *
     * @param id
     */
    void delTask(Long id);

    /**
     * 修改任务状态
     *
     * @param id
     * @param status
     */
    void updateStatus(Long id, Boolean status);

    /**
     * 用户任务列表
     *
     * @param userInfo
     * @return
     */
    List<Task> getUserTaskList(UserInfo userInfo);

    /**
     * 用户任务列表展示格式
     *
     * @param userInfo
     * @return
     */
    List<TaskListVO> getUserTaskListVO(UserInfo userInfo);

    /**
     * 用户任务列表展示格式
     * 商户任务
     *
     * @param userInfo
     * @return
     */
    List<TaskListVO> getUserMerchantTaskListVO(UserInfo userInfo);

    /**
     * 待领取任务奖励
     */
    List<TaskDrawPrize> getTaskPrize(UserInfo userInfo);

    /**
     * 领取任务奖励
     *
     * @param user
     * @param id
     */
    void drawPrize(UserInfo user, Long id);

    /**
     * 完成任务
     * @return
     */
    void finishTask(UserInfo userInfo, TaskOrderTypeEnum type, TaskTypeEnum taskType, Long linkId, Long productId, BigDecimal price);

    /**
     * 秘境添加奖励
     * @param userId 用户Id
     * @param mysticId 秘境Id
     * @param pledgeId 质押Id
     * @param name 秘境名称
     * @param prizeDTOS 奖励列表
     */
    void addDrawPrize(Long userId, Long mysticId , Long pledgeId, String name , List<DrawPrizeDTO> prizeDTOS , DrawPriceTypeEnum drawPriceTypeEnum);

    /**
     * 兑换盲盒
     *
     * @param userInfo
     * @param id
     * @param num
     */
    void exchangeBox(UserInfo userInfo, Long id, int num) ;



}
